/*
 * @Description: TB6612驱动程序
 * @Author: diyhome
 * @Gitee: https://gitee.com/jingjiangxueyuan_hmqs
 * @Date: 2019-10-04 16:44:21
 * @LastEditors: diyhome
 * @LastEditTime: 2019-10-04 17:10:03
 */
#ifndef TB6612_H
#define TB6612_H

#include "Arduino.h"

class TB6612
{
public:
    /**
     * @description: TB6612的初始化程序
     * @param {type} Port[7] = {PWMA, AIN2, AIN1, STBY, BIN1, BIN2, PWMB}
     * @return: 
     */
    TB6612(int Port[7]);
    /**
     * @description: TB6612 的控制函数
     * @param {type} int pwm:输入的pwm量[0,255]; int state:输入前进后退控制 0->前进 1->后退 默认向前
     * @return: 
     */
    void CtrlTB6612(int pwm, int state_A, int state_B);

private:
    int SPort[7] = {0};
};
#endif